<?php
$this->breadcrumbs = array(
    '添加院系',
);
?>
<form class="form-horizontal" action="<?php echo Yii::app()->createUrl('/admin/school/subjects') ;?>" method="post">
    <fieldset>
        <div class="control-group">
            <label class="control-label" for="School[cnname]">院系列表</label>
            <div class="controls">
                <?php $checkedSubs = explode(',', $school->subjects) ?>
                <?php if(!empty($subjects)): ?>
                <?php foreach ($subjects as $subject): ?>
                <label><?php echo $subject->cnname; ?>
                    <input type="checkbox" value="<?php echo $subject->id; ?>" 
                           checked="<? echo in_array($subject->id, $checkedSubs) ? 'checked' : ''?>" 
                       class="input-xlarge" name="subjects[]">
                </label>
                <?php endforeach; ?>
                <?php endif; ?>
            </div>
        </div>
        <div class="control-group">
            <input type="hidden" name="school_id" value="<?php echo $school->id; ?>">
            <input type="submit" value="下一步">
        </div>
    </fieldset>
</form>